﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.Models.Cliente>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
    </p>
    <h2>
        <center>
            Lista de clientes
            <center />
    </h2>
    <p>
    </p>
    <table>
        <tbody>
            <tr>
                <th>
                    Nome
                </th>
                <th>
                    Cpf
                </th>
                <th>
                    Email
                </th>
                <th>
                    Telefone
                </th>
                <th>
                    Cidade
                </th>
                <th>
                    Estado
                </th>
                <th>
                    Opções
                </th>
            </tr>
            <% foreach (var item in Model)
               { %>
            <tr class="table-row">
                <%: Html.HiddenFor(modelItem => item.Id_Cliente) %>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Nome) %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Cpf) %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Email) %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Telefone) %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Cidade) %>
                </td>
                <td>
                    <%: Html.DisplayFor(modelItem => item.Estado) %>
                </td>
                <td>
                    <%: Html.ActionLink("Editar", "Edit", new { id=item.Id_Cliente }) %>
                    |
                    <%: Html.ActionLink("Detalhes", "Details", new {  id=item.Id_Cliente }) %>
                    |
                    <%: Html.ActionLink("Deletar", "Delete", new {  id=item.Id_Cliente }) %>
                </td>
            </tr>
            <% } %>
        </tbody>
    </table>
    <br />
    <br />
    <input type="button" value="Novo Cliente" class="button dark" onclick="location.href='<%: Url.Action("Create", "Cliente") %>'" />
    </section>
</asp:Content>
